# while取偶数
# list1 = [1,2,3,4,5,6,7,8,9,10]
# index=0
# list2=[]
# while index < len(list1):
#     if list1[index]%2==0:
#         list2.append(list1[index])
#     index += 1
# print(list2)
# for循环取偶数
list3=[1,2,3,4,5,6,7,8,9,10]
list4=[]
for i in list3:
    if i%2==0:
        list4.append(i)
print(list4)
